def solve():
    s = input()
    d = {}
    for c in s:
        d[c] = d.get(c, 0) + 1
    for k, v in d.items():
        print(k, v)


if __name__ == "__main__":
    solve()
